<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./react_dom/react/react17.development.js"></script>
    <script src="./react_dom/react/react-dom17.development.js"></script>
    <script src="./react_dom/react/babel.min.js"></script>
</head>

<body>
    <div id="main"></div>
    <script type="text/babel">
        function Com(props) {
            // 只读
            console.log(props)
            
            return (<div>
                这是div的内容
                <ComTwo
                    num='20'
                    str='字符内容'
                    bool={true}
                    arr={['qqq', 'eee', 'ttt']}
                    obj={{ name: 'lili', age: 18 }}
                    title={props.title}

                ></ComTwo>
            </div>)
        }

        function ComTwo(props) {
            console.log(props)
            return (<div>
                <p>{props.num}</p>
                <p>{props.str}</p>

            </div>)
        }
        // 在组件标签上设置自定义属性  会将这个属性与值传递给这个组件
        ReactDOM.render(<Com title='提示内容' />, document.getElementById('main'))
    </script>


</body>

</html>